package STUDENT.NGUYENTRUNGKIEN;

import java.util.Scanner;

public class Square {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double a = 0, s = 0, p = 0;
		String strValue = "";

		do {
			System.out.println("nhap gia tri canh a");
			strValue = sc.nextLine();
			if (strValue.isEmpty())
				System.out.println("gia tri canh a bat buoc phai nhap");
			else
				a = Double.parseDouble(strValue);
		} while (strValue.isEmpty());
		if (a > 0) {
			p = a * 4;
			System.out.println("chu vi hinh vuong la " + p);
			s = a * a;
			System.out.println("dien tich hihn vuong la " + s);
		} else {
			System.out.println("gia tri khong hop le");
		}
	}
}